package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.GuihuanItemSLDTO;
import com.neusoft.neuiotms.dcam.workflow.model.GuihuanItemSL;

@Component
public class GuihuanItemSLConverter extends AbstractConverter<GuihuanItemSL, GuihuanItemSLDTO> {

    @Override
    public GuihuanItemSL toModel(final GuihuanItemSLDTO dto) {

        final GuihuanItemSL model = new GuihuanItemSL();

        model.setName(dto.getName());
        model.setCode(dto.getCode());
        model.setSpecifications(dto.getSpecifications());
        model.setSerialnumber(dto.getSerialnumber());
        model.setBigTypeName(dto.getBigTypeName());
        model.setBigTypeCode(dto.getBigTypeCode());
        model.setMiddleTypeName(dto.getMiddleTypeName());
        model.setMiddleTypeCode(dto.getMiddleTypeCode());
        model.setSmallTypeName(dto.getSmallTypeName());
        model.setSmallTypeCode(dto.getSmallTypeCode());
        model.setGuihuanUserCode(dto.getGuihuanUserCode());
        model.setGuihuanUserName(dto.getGuihuanUserName());
        model.setGuihuanLocation(dto.getGuihuanLocation());
        model.setGuihuanLocationName(dto.getGuihuanLocationName());
        model.setStatus(dto.getStatus());
        return model;
    }

    @Override
    public GuihuanItemSLDTO toDTO(final GuihuanItemSL model, final boolean forListView) {
        final GuihuanItemSLDTO dto = new GuihuanItemSLDTO();
        dto.setId(model.getId());
        dto.setName(model.getName());
        dto.setCode(model.getCode());
        dto.setSpecifications(model.getSpecifications());
        dto.setSerialnumber(model.getSerialnumber());
        dto.setBigTypeName(model.getBigTypeName());
        dto.setBigTypeCode(model.getBigTypeCode());
        dto.setMiddleTypeName(model.getMiddleTypeName());
        dto.setMiddleTypeCode(model.getMiddleTypeCode());
        dto.setSmallTypeName(model.getSmallTypeName());
        dto.setSmallTypeCode(model.getSmallTypeCode());
        dto.setGuihuanUserCode(model.getGuihuanUserCode());
        dto.setGuihuanUserName(model.getGuihuanUserName());
        dto.setGuihuanLocation(model.getGuihuanLocation());
        dto.setGuihuanLocationName(model.getGuihuanLocationName());
        dto.setStatus(model.getStatus());
        return dto;
    }

}
